#ifndef FACEATTENDENCE_H
#define FACEATTENDENCE_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QTimer>
#include <QDataStream>
#include <QPixmap>

// OpenCV头文件引用 - 适配交叉编译环境
#ifdef CMAKE_CROSSCOMPILING
    #include <opencv4/opencv2/opencv.hpp>
    #include <opencv4/opencv2/objdetect.hpp>
    #include <opencv4/opencv2/imgproc.hpp>
    #include <opencv4/opencv2/highgui.hpp>
    #include <opencv4/opencv2/videoio.hpp>
#else
    #include <opencv2/opencv.hpp>
    #include <opencv2/objdetect.hpp>
    #include <opencv2/imgproc.hpp>
    #include <opencv2/highgui.hpp>
    #include <opencv2/videoio.hpp>
#endif

using namespace cv;
using namespace std;

QT_BEGIN_NAMESPACE
namespace Ui
{
    class faceattendence;
}
QT_END_NAMESPACE

class faceattendence : public QMainWindow
{
    Q_OBJECT

public:
    faceattendence(QWidget *parent = nullptr);
    ~faceattendence();
    void timerEvent(QTimerEvent *e);

public slots:
    void QTimer_start();
    void start_connect();
    void end_connect();
    void onSocketReadyRead();
    void updateEmployeeInfo(int employeeID, const QString &name, const QString &currentTime, const QByteArray &imageData, int status);

private:
    Ui::faceattendence *ui;
    VideoCapture cap;
    cv::CascadeClassifier cascade;
    QTimer timer;
    QTcpSocket socket;
};
#endif // FACEATTENDENCE_H
